#猜数字 上机练习
num = 100

print()

for i in range(1,num+1):
    if i % 7 == 0 or (i % 7 != 0 and str(i).count('7')>0 ):
     print(i,end= '')